Skip to content

feat(03): deploylog manual export - #8

Open
marko-builds wants to merge 1 commit into
mainfrom
feat/03-manual-export
Open

feat(03): deploylog manual export#8
marko-builds wants to merge 1 commit into
mainfrom
feat/03-manual-export

Conversation

@marko-builds

Copy link
Copy Markdown
Owner

Closes issues/03-manual-export.md (the CLI half of deploylog #86 / issue 57).

deploylog manual export [--project <slug>] [--out <path>] calls GET /api/cli/manual/export?project=<slug> and writes the whole manual as JSON. The payload is validated against the server's published schema before anything is written.

Mirrored schema: src/manual-schema.ts copies ManualExportResponseSchema, ClaimSchema, ChapterSchema, CommitMapSchema and everything they embed verbatim from deploylog src/lib/schemas.ts @ 946dead (identical bytes to the e4c4637 the issue names; only route.ts changed between those shas). This adds zod ^4 (the server's major) as a runtime dependency.

Acceptance criteria

  • deploylog manual export --project x --out f.json writes the validated payload; control: a fixture with a claim's expect removed exits non-zero and writes nothing (src/manual.test.ts, names versions.0.chapters.0.claims.0.expect)
  • --out - streams to stdout, nothing else on stdout (errors/exit on stderr)
  • 404 from the route exits non-zero with the project slug in the message (401 keeps the existing login nudge)
  • No plan gating anywhere: a test greps manual.ts + manual-schema.ts for plan / can(
  • vitest run (115, was 101), tsc --noEmit, npm run build all pass

Live check (read-only, against prod)

The route is already deployed: manual export --project deploylog --out - returned 1 version / 1 chapter / 26 claims and passed the mirrored schema unchanged; an unknown slug returns the 404 with the slug; a project without a manual returns the "has no manual to export" 404. No shape drift observed.

Not done (by design)

  • No reader / checker / diff / import of the exported file.
  • No version bump, no publish, issue Status line untouched.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

…nswer

`deploylog manual export [--project <slug>] [--out <path>]` calls
GET /api/cli/manual/export and writes the whole manual (every version with
its commit map, every chapter with its claims) as JSON.

- src/manual-schema.ts mirrors ManualExportResponseSchema + ClaimSchema (and
  everything they embed) verbatim from deploylog src/lib/schemas.ts @ 946dead;
  the payload is validated against it before anything is written.
- `--out -` streams the payload to stdout with nothing else on stdout;
  default is ./<slug>-manual.json. Project resolves flag > .deploylog.yml.
- 404 exits non-zero naming the slug; 401 keeps the existing login nudge;
  a schema failure names the first failing path and writes nothing.
- No plan gate anywhere (pinned by a source grep in the test).
- Adds zod ^4 (the server's major) as a runtime dependency for the mirror.

Tests 101 -> 115. No version bump, no publish.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6878a7a2-9822-47d6-aa15-4faf404d4ce1


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

marko-builds added a commit that referenced this pull request Aug 22, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant